package cn.zhb.backend.core.converter;

import cn.zhb.backend.core.dto.UserSaveDto;
import cn.zhb.backend.core.entity.User;
import cn.zhb.backend.core.vo.UserVo;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;

/***
 *@Description
 *@Author ZHB
 *@Create 2025/7/4 下午2:31
 **/
@Mapper(componentModel = "spring")
public abstract class UserConverter {

    @Mappings({
            @Mapping(target = "id", source = "id")
    })
    public abstract UserVo poToVo(User user);

    @Mappings({
            @Mapping(target = "userQuestionRecordList", ignore = true)
    })
    public abstract User saveDtoToPo(UserSaveDto userSaveDto);

}
